<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2018 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 小夏 < 449134904@qq.com>
// +----------------------------------------------------------------------
namespace plugins\hz_msg_borad\validate;

use think\Validate;

class PostValidate extends Validate
{
    protected $regex = [
        // 'mobile'=>'/1[345789]{1}\d{9}$/i',
    ];
    protected $rule = [
        // 用|分开
        'firstName'       => 'require|chsAlpha',
        'lastName'       => 'require|chsAlpha',
        // 'phone'     => 'require|mobile',
        'email' => 'email',
        'msg' => 'require|max:500'
    ];

    protected $message = [
        'firstName.require'       => "Name can't be empty!",
        'firstName.chsAlpha'       => "Names can only be Chinese characters and letters!",
        'lastName.require'       => "Surname can't be empty!",
        'lastName.chsAlpha'       => "The surname can only be Chinese characters and letters!",
        // 'phone.require'     => "Number cannot be empty!",
        // 'phone.mobile'     => "Incorrect format of mobile phone number!",
        'email.email' => 'The mailbox format is incorrect',
        'msg.require' => 'Message content should not be empty',
        'msg.max' => 'Message length should not exceed 500'
    ];


}